package com.one.rope.mvp.web.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Weijian.Liu
 * @desc 获取价格枚举
 * @date 2020/2/20 14:47
 */
@Getter
@AllArgsConstructor
public enum GetPriceEnum {

  /**
   * 1：溢价购买 2：平价购买 3：折价购买 4：免费获赠
   */

  PRICE1(1, "溢价购买"),
  PRICE2(2, "平价购买"),
  PRICE3(3, "折价购买"),
  PRICE4(4, "免费获赠");

  private int code;
  private String name;

  public static String getName(int code) {
    for (GetPriceEnum o : GetPriceEnum.values()) {
      if (o.code == code) {
        return o.name;
      }
    }
    return "";
  }
}
